home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9265 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: argc/argv & switches
  5. Date: 8 Mar 96 15:40:37 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.826299637@rscernix>
  8. References: <4h2j8j$9gn@milo.freenet.vancouver.bc.ca> <danpop.825593142@rscernix> <Dnt8r5.F3w@bear.wn.bawue.de>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <Dnt8r5.F3w@bear.wn.bawue.de> jo@bear.wn.bawue.de (Joerg Sommrey) writes:
  13.  
  14. >In <danpop.825593142@rscernix> danpop@mail.cern.ch (Dan Pop) writes:
  15. >
  16. >>Note that *++argv[0] is technically incorrect, because there is no
  17. >>guarantee that argv[0] can be modified by the program, it can be legally
  18. >>stored in a read only memory segment.
  19. >
  20. >Does this mean there is an incorrect example in K&R2?
  21. >At p.117f they use *++argv[0].
  22.  
  23. Yes, the example at page 117 in K&R2 is incorrect.  It invokes undefined
  24. behaviour.  They probably didn't update the example from K&R1 to comply
  25. with ANSI C.
  26.  
  27. Dan
  28. --
  29. Dan Pop
  30. CERN, CN Division
  31. Email: danpop@mail.cern.ch 
  32. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  33.